package interfaces;

import domain.items.ForumThread;
import domain.items.Topic;
import domain.items.Post;


public interface DataRepository {

/**
 * the forum is actually a tree with a single root topic.
 * the persistence layer should provide access to this root topic so the surfer can will be able to navigate
 * from there.
 * @return
 */
	public Topic getRootTopic();


/**
 * when the surfer is inside a thread and wants to add a post. the post he created should be saved in the
 * data repository by the persistence layer.
 * @param thread
 * @param post
 * @return
 */
	public boolean addPost(Post post);


/**
 * when the surfer wants to edit a post (the edit itself be done in the domain layer,
 * the responsibility of checking permission issue belongs to domain layer).
 * @param post
 * @return
 */
	public boolean updatePost(Post post);


/**
 * when a moderator or admin wants to delete a post
 * (checking permission issue belongs to domain layer).
 * @param post - the post to be deleted
 * @return
 */
	public boolean deletePost(Post post);

/**
 * when the surfer is inside a father topic and wants to create a child topic.
 * @param fatherID
 * @param name
 * @return
 */
	public boolean addTopic(Topic newTopic);


/**
 * same behavior as for adding a post. topic relates to the Topic in which the surfer is currently in.
 * @param topic
 * @param name
 * @return
 */
	public boolean addThread(ForumThread newThread);


/**
 * produces charts according to type.
 * @param type is type of chart.
 * @param username 
 */
public void generateStat(int type, String username);


public void updateUserLoginStat();


}
